var $ = function (b) {
    return document.getElementById(b)
};
var log = function (a) {
    if (window.console) {
        console.log(a)
    }
};
var ec = {
    _cache: {},
    wap: false,
    web: true,
    code: "",
    loginFlag: false
};
String.prototype.endWith = function (a) {
    if (a == null || a == "" || this.length == 0 || a.length > this.length) {
        return false
    }
    if (this.substring(this.length - a.length) == a) {
        return true
    } else {
        return false
    }
    return true
};
String.prototype.startWith = function (a) {
    if (a == null || a == "" || this.length == 0 || a.length > this.length) {
        return false
    }
    if (this.substr(0, a.length) == a) {
        return true
    } else {
        return false
    }
    return true
};
ec.util = {
    toHtml: function (b) {
        return b.replace(/[<>&"']/g, function (a) {
            return "&#x" + a.charCodeAt(0).toString(16) + ";"
        })
    },
    isFunction: function (a) {
        return Object.prototype.toString.call(a) === "[object Function]"
    },
    getParamObj: function (c) {
        var d = {},
            c = (typeof c === "string") ? c : "";
        c.replace(/([^?=&#]+)=([^&]*)/g, function (a, f, b) {
            d[f] = b
        });
        return d
    },
    getRandom: function (c, a) {
        var b = a - c;
        var d = Math.random();
        return (c + Math.round(d * b))
    },
    addScriptTag: function (src, fn) {
        if (!src) {
            return
        }
        with(document) {
            0[(getElementsByTagName("head")[0] || body).appendChild(createElement("script")).src = src]
        }
        if (fn && ec.util.isFunction(fn)) {
            setTimeout(fn, 100)
        }
    },
    ajax: {
        xhr: function () {
            if (window.location.protocol !== "file:") {
                try {
                    return new XMLHttpRequest()
                } catch (a) {}
                try {
                    return new ActiveXObject("Msxml2.XMLHTTP")
                } catch (a) {
                    return new ActiveXObject("Microsoft.XMLHTTP")
                }
            }
        },
        open: function (e) {
            if (!e.url || typeof e.url !== "string" || e.url.length < 5) {
                return
            }
            var c = this.xhr(),
                a = ec.util.isFunction;
            if (c) {
                var b = null;
                e.type = e.type || "GET";
                e.dataType = e.dataType || "json";
                e.async = e.async || true;
                if (e.data && typeof e.data !== "string") {
                    var d = [];
                    for (key in e.data) {
                        d.push(key + "=" + e.data[key])
                    }
                    b = d.join("&")
                }
                if (e.type === "GET" && b) {
                    e.url = e.url + ((e.url.indexOf("?") < 0) ? "?" : "&") + b;
                    b = null
                }
                c.open(e.type, e.url, e.async);
                c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                c.onreadystatechange = function () {
                    if (c.readyState == 4) {
                        if (c.status == 200) {
                            if (e.success && a(e.success)) {
                                var f;
                                if (e.dataType === "json") {
                                    try {
                                        f = JSON.parse(c.responseText)
                                    } catch (g) {
                                        f = (new Function("return " + c.responseText))()
                                    }
                                } else {
                                    f = c.responseText
                                }
                                e.success(f)
                            }
                            return
                        }
                        if (e.error && a(e.error)) {
                            e.error()
                        }
                    }
                };
                c.send(b)
            }
        },
        getJson: function (a) {
            if (a.funName) {
                window[a.funName] = a.success
            }
            ec.util.addScriptTag(a.url)
        }
    },
    cookie: {
        get: function (m) {
            var g = null;
            if (document.cookie && document.cookie != "") {
                var j = document.cookie.split(";");
                for (var k = 0; k < j.length; k++) {
                    var l = (j[k] || "").replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g, "");
                    if (l.substring(0, m.length + 1) == (m + "=")) {
                        var h = function (c) {
                            c = c.replace(/\+/g, " ");
                            var a = '()<>@,;:\\"/[]?={}';
                            for (var b = 0; b < a.length; b++) {
                                if (c.indexOf(a.charAt(b)) != -1) {
                                    if (c.startWith('"')) {
                                        c = c.substring(1)
                                    }
                                    if (c.endWith('"')) {
                                        c = c.substring(0, c.length - 1)
                                    }
                                    break
                                }
                            }
                            return decodeURIComponent(c)
                        };
                        g = h(l.substring(m.length + 1));
                        break
                    }
                }
            }
            return g
        },
        set: function (k, r, m) {
            m = m || {};
            if (r === null) {
                r = "";
                m.expires = -1
            }
            var o = "";
            if (m.expires && (typeof m.expires == "number" || m.expires.toUTCString)) {
                var n;
                if (typeof m.expires == "number") {
                    n = new Date();
                    n.setTime(n.getTime() + (m.expires * 24 * 60 * 60 * 1000))
                } else {
                    n = m.expires
                }
                o = "; expires=" + n.toUTCString()
            }
            var p = "; path=" + (m.path || "/");
            var l = ".vmall.com";
            var j = "; domain=" + l;
            var q = m.secure ? "; secure" : "";
            document.cookie = [k, "=", encodeURIComponent(r), o, p, j, q].join("")
        },
        remove: function (b) {
            this.set(b, null)
        }
    },
    countdown: function (p, n) {
        var k = $(p),
            o = ec._cache[p + n.startTime],
            r, l = n.now - new Date().getTime(),
            m = 0,
            j = function () {
                m = Math.round((n.startTime - new Date().getTime() - l) / 1000);
                m = m <= 0 ? 0 : m
            },
            q = function () {
                j();
                if (m <= 0) {
                    m = 0
                }
                r = {
                    day: Math.floor(m / (24 * 60 * 60)),
                    hour: (n.html.indexOf("{#day}") >= 0) ? Math.floor(m / 60 / 60) % 24 : Math.floor(m / 60 / 60),
                    minute: Math.floor(m / 60) % 60,
                    second: m % 60
                };
                var a = n.html.replace(/{#day}/g, r.day).replace(/{#hours}/g, r.hour > 9 ? r.hour : "0" + r.hour).replace(/{#minutes}/g, r.minute > 9 ? r.minute : "0" + r.minute).replace(/{#seconds}/g, r.second > 9 ? r.second : "0" + r.second);
                k.innerHTML = a;
                return (m <= 0) ? false : true
            };
        j();
        clearInterval(o);
        if (!q()) {
            if (n.callback) {
                n.callback(n)
            }
            return
        }
        o = setInterval(function () {
            if (!q()) {
                if (n.callback) {
                    n.callback(n)
                }
                clearInterval(o)
            }
        }, 1000);
        ec._cache[p + n.startTime] = o
    }
};
ec.fixed = function (f, j) {
    var f = $(f),
        h = document.compatMode == "CSS1Compat" ? document.documentElement : document.body,
        a = f.offsetTop + h.offsetTop,
        k = 0;
    var b = !!window.ActiveXObject;
    var e = b && !window.XMLHttpRequest;
    var c = b && !!document.documentMode;
    var d = b && !e && !c;
    if (e) {
        var g;
        window.onscroll = function () {
            window.clearTimeout(g);
            g = window.setTimeout(function () {
                k = h.scrollTop;
                if (k >= a) {
                    f.setAttribute("style", "bottom:10px");
                    return
                }
                f.setAttribute("style", " ")
            }, 60)
        }
    }
    $("tools-nav-service-robotim").setAttribute("href", "//robotim.vmall.com/live800/chatClient/chatbox.jsp?companyID=8922&configID=10&skillId=17&enterurl=" + encodeURIComponent(window.location.href) + "&k=1&remark=")
};
var _paq = _paq || [];
ec.analytics = function (c) {
    if (c.bd) {
        var a = "//hm.baidu.com/h.js?82d2186024cf7459f80be3ff94bea77f";
        ec.util.addScriptTag(a)
    }
    if (c.dmp) {
        var b = "//nebula-collector.huawei.com/api/2.0/vmallcn-min.js";
        ec.util.addScriptTag(b)
    }
    if (c.bi) {
        if (location.protocol == "http:") {
            _paq.push(["setTrackerUrl", "http://datacollect.vmall.com:28080/webv1"])
        } else {
            if (location.protocol == "https:") {
                _paq.push(["setTrackerUrl", "https://datacollect.vmall.com:18443/webv1"])
            }
        }
        _paq.push(["setSiteId", "sale.vmall.com"]);
        _paq.push(["setCustomVariable", 1, "cid", (ec.util.cookie.get("cps_id") || ""), "page"]);
        _paq.push(["setCustomVariable", 2, "direct", (ec.util.cookie.get("cps_direct") || ""), "page"]);
        _paq.push(["setCustomVariable", 4, "wi", (ec.util.cookie.get("cps_wi") || ""), "page"]);
        _paq.push(["setCustomVariable", 9, "deviceID", (ec.util.cookie.get("deviceID_BI") || ""), "visit"]);
        _paq.push(["setCustomVariable", 10, "uid", (ec.util.cookie.get("uid") || ""), "visit"]);
        _paq.push(["trackPageView"]);
        var b = "//res.vmallres.com/bi/hianalytics_v15.js";
        ec.util.addScriptTag(b)
    }
};
ec.biAnalytics = function () {
    setTimeout(function () {
        _paq.bindClick("choose_products");
        _paq.bindClick("subject");
        _paq.bindClick("answer")
    }, 500)
};
ec.ajax = function (a) {
    ec.util.ajax.open(a)
};
ec.getJson = function (a) {
    ec.util.ajax.getJson(a)
};
ec.isRequestFromVmall = false;
ec.paramForVmall = {};
var fromVmallSkuList = {};
ec.isFireRequest = true;
ec.initForVmall = function () {
    if (ec.isPreview) {
        return
    }
    if (location.search == "") {
        return
    }
    var f = ec.util.getParamObj(location.search);
    if (f.mainSku && f.mainSku != "" && f.backUrl && f.backUrl != "") {
        for (var e = 0; e < 1; e++) {
            if (isNaN(f.mainSku)) {
                break
            }
            var a = true;
            var d = new Array();
            if (f.giftSkus && f.giftSkus != "") {
                d = f.giftSkus.split(",");
                for (var b = 0; b < d.length; b++) {
                    if (isNaN(d[b])) {
                        a = false;
                        break
                    }
                }
            }
            if (!a) {
                break
            }
            if (f.accessoriesSkus && f.accessoriesSkus != "") {
                d = f.accessoriesSkus.split(",");
                for (var b = 0; b < d.length; b++) {
                    if (isNaN(d[b])) {
                        a = false;
                        break
                    }
                }
            }
            if (!a) {
                break
            }
            ec.paramForVmall.backUrl = decodeURIComponent(f.backUrl);
            if (ec.paramForVmall.backUrl.indexOf("vmall.com") == -1) {
                break
            }
            if (ec.endPage == true) {
                if (ec.paramForVmall.backUrl) {
                    location.href = ec.paramForVmall.backUrl
                } else {
                    location.href = ec.url.vmall
                }
                return
            }
            ec.paramForVmall.activityUrl = ec.url.activity;
            ec.paramForVmall.mainSkuId = f.mainSku;
            if (f.giftSkus) {
                ec.paramForVmall.giftSkus = f.giftSkus
            }
            if (f.accessoriesSkus) {
                ec.paramForVmall.accessoriesSkus = f.accessoriesSkus
            }
            var c = false;
            for (skuGroupIndex in ec.skuList) {
                for (skuIndex in ec.skuList[skuGroupIndex].skuInfo) {
                    var g = ec.skuList[skuGroupIndex].skuInfo[skuIndex];
                    if (g.type == 1 && g.id == f.mainSku) {
                        ec.paramForVmall.skuIdInActivity = g.id;
                        c = true;
                        break
                    } else {
                        if (g.type == 3 && g.mainSkuId == f.mainSku) {
                            ec.paramForVmall.skuIdInActivity = g.id;
                            c = true;
                            break
                        }
                    }
                }
                if (c) {
                    break
                }
            }
            if (ec.paramForVmall.skuIdInActivity) {
                ec.selectedProduct.skuId = ec.paramForVmall.skuIdInActivity;
                ec.isRequestFromVmall = true;
                ec.url.activity = ec.paramForVmall.backUrl
            } else {
                location.href = ec.paramForVmall.backUrl;
                return
            }
        }
    }
    if (ec.isRequestFromVmall) {
        $("activity_main").style.display = "none";
        $("honor-footer").style.display = "none";
        fromVmallSkuList = ec.skuList;
        ec.skuList = [];
        ec.showMsgWait()
    } else {
        if (location.hash == "") {
            location.href = ec.url.activity
        }
    }
};
ec.setLoginUrlForVmall = function () {
    var b = ec.paramForVmall.activityUrl;
    var a = "";
    if (ec.paramForVmall.mainSkuId) {
        a += "mainSku=" + ec.paramForVmall.mainSkuId
    }
    if (ec.paramForVmall.giftSkus) {
        a += "&giftSkus=" + ec.paramForVmall.giftSkus
    }
    if (ec.paramForVmall.accessoriesSkus) {
        a += "&accessoriesSkus=" + ec.paramForVmall.accessoriesSkus
    }
    if (ec.paramForVmall.backUrl) {
        a += "&backUrl=" + encodeURIComponent(ec.paramForVmall.backUrl)
    }
    ec.loginUrl = ec.casLoginUrlDomain + "/CAS/remoteLogin?service=" + encodeURIComponent(b + "?" + a) + "&loginChannel=26000000&reqClientType=26&loginUrl=" + ec.portalLoginUrlDomain + "/CAS/portal/login.html&quickAuth=true"
};
ec.getBackUrl = function () {
    var b = ec.paramForVmall.activityUrl;
    var a = "";
    if (ec.paramForVmall.mainSkuId) {
        a += "mainSku=" + ec.paramForVmall.mainSkuId
    }
    if (ec.paramForVmall.giftSkus) {
        a += "&giftSkus=" + ec.paramForVmall.giftSkus
    }
    if (ec.paramForVmall.accessoriesSkus) {
        a += "&accessoriesSkus=" + ec.paramForVmall.accessoriesSkus
    }
    if (ec.paramForVmall.backUrl) {
        a += "&backUrl=" + encodeURIComponent(ec.paramForVmall.backUrl)
    }
    return b + "?" + a
};
ec.fireRequestForVmall = function () {
    if (ec.isRequestFromVmall) {
        if (!ec.account.isLogin()) {
            ec.setLoginUrlForVmall();
            location.href = ec.loginUrl;
            return
        }
        ec.showMsgWait();
        if (ec.isRequestFromVmall && !ec.isFireRequest) {
            return
        }
        if (ec.joinRequestCount >= ec.quitRequestCount) {
            if (ec.retryFun) {
                clearTimeout(ec.retryFun)
            }
            if (ec.oneMin) {
                clearTimeout(ec.oneMin)
            }
            ec.showMessageBox(1);
            $("boxButton").innerHTML = '<a href="' + ec.url.activity + '" title="看看其它商品" class="honor-box-btn" >看看其它商品</a><a href="javascript:;" onclick="ec.closeBox();ec.fireAgainRequestForVmall();return false;" title="再试一次" class="honor-box-btn-go" >再试一次</a>';
            return
        }
        ec.joinRequestCount = ec.joinRequestCount + 1;
        setTimeout(function () {
            if (ec.buyError) {
                clearTimeout(ec.buyError)
            }
            ec.submit()
        }, 500)
    }
};
ec.fireAgainRequestForVmall = function () {
    ec.joinRequestCount = 0;
    ec.fireRequestForVmall()
};
(function () {
    var a = ["uid", "user", "name", "ts", "valid", "sign", "cid", "wi", "ticket", "hasphone", "hasmail", "logintype"],
        b = ec.util.cookie;
    ec.account = {
        isLogin: function () {
            var d = b.get("uid"),
                e = b.get("user"),
                c = b.get("name");
            return (d && e && c)
        },
        setLoginInfo: function () {
            var c;
            var f = location.hash;
            c = ec.util.getParamObj(f);
            for (i = 0; i < a.length; i += 1) {
                if (a[i] == "cid" || a[i] == "wi") {
                    continue
                }
                if (c[a[i]]) {
                    if (a[i] == "user" || a[i] == "name") {
                        c[a[i]] = c[a[i]].replace(/\+/g, "%20")
                    }
                    b.set(a[i], decodeURIComponent(c[a[i]]))
                }
            }
            var e = {};
            e.expires = 1;
            if (c.cid) {
                b.set("cps_id", decodeURIComponent(c.cid), e)
            }
            if (c.wi) {
                b.set("cps_wi", decodeURIComponent(c.wi), e)
            }
            if (c.tag && c.tag == 1) {
                if (ec.isRequestFromVmall) {
                    ec.setLoginUrlForVmall()
                }
                location.href = ec.loginUrl;
                return
            }
            if (f && f.length > 0) {
                if (ec.isRequestFromVmall) {
                    var d = "";
                    if (ec.paramForVmall.mainSkuId) {
                        d += "mainSku=" + ec.paramForVmall.mainSkuId
                    }
                    if (ec.paramForVmall.giftSkus) {
                        d += "&giftSkus=" + ec.paramForVmall.giftSkus
                    }
                    if (ec.paramForVmall.accessoriesSkus) {
                        d += "&accessoriesSkus=" + ec.paramForVmall.accessoriesSkus
                    }
                    if (ec.paramForVmall.backUrl) {
                        d += "&backUrl=" + encodeURIComponent(ec.paramForVmall.backUrl)
                    }
                    location.href = ec.paramForVmall.activityUrl + "?" + (d);
                    return
                }
                location.href = ec.url.activity
            }
        },
        getLoginInfo: function () {
            var d = b.get("name"),
                c = "";
            $("login-btn-1").style.display = "none";
            $("user_login_name").innerHTML = "欢迎您，" + d;
            $("user_login_name").style.display = "inline";
            $("logout").style.display = "inline";
            ec.loginFlag = true
        },
        getLoginPars: function () {
            var c = "";
            for (i = 0; i < a.length; i += 1) {
                var d = encodeURIComponent(b.get(a[i]));
                if (d) {
                    c += "&" + a[i] + "=" + d
                }
            }
            return c
        },
        logout: function () {
            var c = ec.util.cookie.get("uid");
            for (i = 0; i < a.length; i += 1) {
                ec.util.cookie.remove(a[i])
            }
            ec.util.cookie.remove("hasImg");
            ec.util.cookie.remove("isqueue-" + ec.activityId + "-" + c);
            ec.util.cookie.remove("queueSign-" + ec.activityId + "-" + c);
            location.href = ec.logoutUrl + ec.url.activity
        },
        init: function () {
            this.setLoginInfo();
            if (this.isLogin()) {
                this.getLoginInfo();
                return
            }
            if (!ec.endPage) {
                $("honor-btn").innerHTML = '<a id="login-btn-2" class="honor-btn-advance" title="提前登录" href="#">提前登录</a>'
            }
            ec.util.cookie.remove("hasImg")
        },
        isBindPhone: function () {
            var e = b.get("hasphone"),
                c = b.get("hasmail"),
                d = b.get("logintype");
            return e && (1 == e) && c && d
        },
        change: function () {
            var c = ec.util.cookie.get("uid");
            for (i = 0; i < a.length; i += 1) {
                ec.util.cookie.remove(a[i])
            }
            ec.util.cookie.remove("hasImg");
            ec.util.cookie.remove("isqueue-" + ec.activityId + "-" + c);
            ec.util.cookie.remove("queueSign-" + ec.activityId + "-" + c);
            if (ec.isRequestFromVmall) {
                ec.setLoginUrlForVmall()
            }
            location.href = ec.logoutUrl + encodeURIComponent(ec.loginUrl)
        },
        toBindPhone: function () {
            if (ec.isRequestFromVmall) {
                location.href = ec.bindPhoneUrlDomain + "/oauth2/userCenter/bindAccount/bindMobileAccount_1.jsp?lang=zh-cn&themeName=cloudTheme&reqClientType=26&redirect_uri=" + encodeURIComponent(ec.getBackUrl() + "#tag=1")
            } else {
                location.href = ec.bindPhoneUrl
            }
        }
    }
})();
ec.getOffset = function (a) {
    var b = {
        top: 0,
        left: 0
    };
    while (a) {
        b.top += a.offsetTop;
        b.left += a.offsetLeft;
        a = a.offsetParent
    }
    return b
};
ec.getTagById = function (b, a) {
    for (tag in ec.groupTag[b].tags) {
        if (ec.groupTag[b].tags[tag].id == a) {
            return ec.groupTag[b].tags[tag]
        }
    }
};
ec.isTagsEqualToSelected = function (a, b) {
    for (i = 0; i < b.length; i++) {
        if (b[i] != a[i]) {
            return false
        }
    }
    return true
};

function uniqueTag(e) {
    var a = [],
        d = {};
    for (var b = 0, c; b < e.length; b++) {
        c = e[b].id;
        if (!d[c]) {
            a.push(e[b]);
            d[c] = true
        }
    }
    return a
}
ec.getNextLevelTagList = function (b) {
    if (b.length == ec.groupTag.length) {
        return null
    }
    var a = new Array();
    for (skuGroup in ec.skuList) {
        if (ec.isTagsEqualToSelected(ec.skuList[skuGroup].groupTag, b)) {
            a.push(ec.getTagById(b.length, ec.skuList[skuGroup].groupTag[b.length]))
        }
    }
    a = uniqueTag(a);
    return a
};
ec.getSkuListBySelectedTags = function (a) {
    if (a.length == ec.groupTag.length) {
        for (skuGroup in ec.skuList) {
            if (ec.isTagsEqualToSelected(ec.skuList[skuGroup].groupTag, a)) {
                return ec.skuList[skuGroup].skuInfo
            }
        }
    }
};
ec.getFirstTagHasSku = function (a) {
    return a[ec.tagNum]
};
ec.getInitSkuList = function () {
    var b = new Array();
    if (ec.groupTag.length > 0) {
        b.push(ec.getFirstTagHasSku(ec.groupTag[0].tags).id);
        for (var a = 1; a < ec.groupTag.length; a++) {
            b.push(ec.getNextLevelTagList(b)[0].id)
        }
    }
    return ec.getSkuListBySelectedTags(b)
};
ec.getSkuById = function (a) {
    for (skuGroup in ec.skuList) {
        for (sku in ec.skuList[skuGroup].skuInfo) {
            if (ec.skuList[skuGroup].skuInfo[sku].id == a) {
                return ec.skuList[skuGroup].skuInfo[sku]
            }
        }
    }
    return null
};
ec.setPackTagName = function () {
    if (ec.selectedProduct.groupTagIds.length > 1) {
        var a = ec.groupTag[ec.selectedProduct.groupTagIds.length - 2].tags;
        var g = ec.selectedProduct.groupTagIds.length;
        for (var c in a) {
            var h = a[c].id;
            for (skuTagNum in ec.skuList) {
                var e = ec.skuList[skuTagNum].groupTag.length;
                if (e <= 3 && ec.skuList[skuTagNum].groupTag[e - 2] == h) {
                    for (var b in ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags) {
                        var f = ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags[b].id;
                        if (ec.skuList[skuTagNum].groupTag[e - 1] == f && ec.selectedProduct.groupTagIds[e - 2] == h) {
                            var d = "skuGroupTagText-" + ec.skuList[skuTagNum].groupTag[e - 1];
                            if (document.getElementById(d)) {
                                document.getElementById(d).innerHTML = ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags[b].name + " &yen; " + ec.skuList[skuTagNum].skuInfo[0].price
                            }
                        }
                    }
                } else {
                    if (e == 4 && ec.skuList[skuTagNum].groupTag[e - 3] == ec.selectedProduct.groupTagIds[e - 3]) {
                        for (var b in ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags) {
                            var f = ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags[b].id;
                            if (ec.skuList[skuTagNum].groupTag[e - 1] == f && ec.skuList[skuTagNum].groupTag[e - 3] == ec.selectedProduct.groupTagIds[e - 3] && ec.skuList[skuTagNum].groupTag[e - 2] == ec.selectedProduct.groupTagIds[e - 2]) {
                                var d = "skuGroupTagText-" + ec.skuList[skuTagNum].groupTag[e - 1];
                                if (document.getElementById(d)) {
                                    document.getElementById(d).innerHTML = ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags[b].name + " &yen; " + ec.skuList[skuTagNum].skuInfo[0].price
                                }
                            }
                        }
                    } else {
                        if (e == 5 && ec.skuList[skuTagNum].groupTag[e - 4] == ec.selectedProduct.groupTagIds[e - 4]) {
                            for (var b in ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags) {
                                var f = ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags[b].id;
                                if (ec.skuList[skuTagNum].groupTag[e - 1] == f && ec.skuList[skuTagNum].groupTag[e - 4] == ec.selectedProduct.groupTagIds[e - 4] && ec.skuList[skuTagNum].groupTag[e - 3] == ec.selectedProduct.groupTagIds[e - 3] && ec.skuList[skuTagNum].groupTag[e - 2] == ec.selectedProduct.groupTagIds[e - 2]) {
                                    var d = "skuGroupTagText-" + ec.skuList[skuTagNum].groupTag[e - 1];
                                    if (document.getElementById(d)) {
                                        document.getElementById(d).innerHTML = ec.groupTag[ec.selectedProduct.groupTagIds.length - 1].tags[b].name + " &yen; " + ec.skuList[skuTagNum].skuInfo[0].price
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
};
ec.getSelectedSkuDesc = function (b) {
    var a = "<span>";
    if (ec.selectedProduct.skuId != null && typeof (ec.selectedProduct.skuId) != "undefined" && ec.selectedProduct.skuId != 0) {
        ec.setPackTagName();
        a += "已选择：" + ec.selectedProduct.prodName;
        for (tagName in ec.selectedProduct.groupTags) {
            if (ec.groupTags.length == 1 && tagName == 0) {
                continue
            } else {
                a += " " + ec.selectedProduct.groupTags[tagName]
            }
        }
        a += " &yen; " + ec.selectedProduct.price;
        if (b) {
            a += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="ec.reSelectTagAndSku();">重新选择 ></a>'
        }
    } else {
        a += "请先选择要购买的商品";
        if (b) {
            a += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="ec.gotoSelectTagAndSku();">去选择 ></a>'
        }
    }
    a += "</span>";
    return a
};
ec.createGroupNode = function (e, d, b, c) {
    var a = "";
    for (tag in d) {
        if (c >= 0) {
            a += ec.createGroupTagNode(e, d[tag], b, tag)
        } else {
            a += ec.createGroupTagNode(e, d[tag], b, -1)
        }
    }
    return a
};
ec.createGroupTagNode = function (e, a, b, c) {
    var d = "";
    if (a.hasSku) {
        d = "<li " + ((!b || a.isSoldOut == 0) ? 'class="honor-version-past"' : (' onclick="ec.selectGroupTagWithSku(' + e + "," + a.id + "," + a.isSoldOut + "," + c + ')"')) + ' id="skuGroupTag-' + a.id + '"> <div class="honor-version-cont"> <p class="honor-version-tit" id="skuGroupTagText-' + a.id + '">' + a.name + '</p> <span class="honor-version-radio"></span> </div> </li>'
    }
    return d
};
ec.createSkuGroupNode = function (c, b) {
    var a = "";
    var d = new Array();
    for (sku in c) {
        a += ec.createSkuNode(c[sku], b);
        if (c[sku].type == 3) {
            d.push(c[sku])
        }
    }
    if (d.length > 0) {
        a += ec.createContrastPackage(d)
    }
    return a
};
ec.createSkuNode = function (c, b) {
    var a = "<li " + ((!b || c.isSoldOut == 0) ? 'class="honor-version-past"' : (' onclick="ec.selectSku(' + c.id + "," + c.isSoldOut + ')"')) + ' id="prod-' + c.id + '" > <div class="honor-version-cont">';
    a += '<p class="honor-version-tit">' + c.name + "&nbsp;&yen;&nbsp;" + c.price + "</p>";
    a += '<span class="honor-version-radio"></span> </div> </li>';
    return a
};
ec.createContrastPackage = function (b) {
    var a = " <li >";
    a += ' 		<div class="honor-version-all clearfix" id="contrastAllPackage">';
    a += ' 		<a href="javascript:;" class="honor-version-all-tit" onclick="ec.showPackage()">对比全部套餐 &gt;</a>';
    a += ' 			<div class="honor-version-layout" style="display:none" id="packageinfo" >';
    a += ' 				<div class="honor-version-layout-hd">';
    a += " 					<table>";
    a += " 						<tr>";
    a += ' 							<th class="tr-package-name">&nbsp;&nbsp;</th>';
    a += ' 							<th class="tr-package-prod">套餐内容</th>';
    a += ' 							<th class="tr-package-save">节省</th>';
    a += ' 							<th class="tr-package-price">套餐价</th>';
    a += " 						</tr>";
    a += " 					</table>";
    a += " 				</div>";
    a += ' 				<div class="honor-version-layout-bd">';
    a += " 					<table>";
    for (packageData in b) {
        if (b[packageData].saveMoney == null || typeof (b[packageData].saveMoney) == "undefined") {
            b[packageData].saveMoney = 0
        }
        a += " 					<tr>";
        a += ' 						<td class="tr-package-name">' + b[packageData].name + "</td>";
        a += ' 						<td class="tr-package-prod">' + b[packageData].pDescription + "</td>";
        a += ' 						<td class="tr-package-save">&yen;&nbsp;' + b[packageData].saveMoney + "</td>";
        a += ' 						<td class="tr-package-price">&yen;&nbsp;' + b[packageData].price + "</td>";
        a += " 					</tr>"
    }
    a += " 					</table>";
    a += " 				</div>";
    a += " 			</div>";
    a += " 		</div>";
    a += " 	</li>";
    return a
};
ec.init = function (b, a) {
    if (ec.isRequestFromVmall) {
        return
    }
    ec.initHasSkuData();
    ec.initSkuGroupTag(b);
    if (a) {
        ec.autoSelectTagAndSku();
        ec.loadSkuStatus()
    }
    ec.setScrollAction();
    ec.loadStatus = 1;
    if (ec.selectedProduct.groupTagIds.length == 0 || ec.selectedProduct == undefined) {
        ec.setOverPackTagName()
    }
};
ec.setOverPackTagName = function () {
    var e = "";
    ec.groupTag = ec.groupTags[ec.tagNum];
    var d = ec.groupTag.length;
    for (var b in ec.groupTag[d - 1].tags) {
        var f = ec.groupTag[d - 1].tags[b].id;
        for (var a in ec.skuList) {
            if (ec.skuList[a].groupTag[d - 1] == f && e.indexOf(f + "")) {
                e = e + "," + f;
                var c = "skuGroupTagText-" + ec.skuList[a].groupTag[d - 1];
                if (document.getElementById(c)) {
                    document.getElementById(c).innerHTML = ec.groupTag[d - 1].tags[b].name + " &yen; " + ec.skuList[a].skuInfo[0].price
                }
            }
        }
    }
};
ec.isOutSku = function () {
    var c = [];
    var e = false,
        d = 0,
        a = 0,
        b = 0;
    for (skuIndex in ec.skuList) {
        if (ec.skuList[skuIndex].isSoldOut != 0) {
            c.push(ec.skuList[skuIndex].groupTag[0]);
            e = true
        }
        if (ec.skuList[skuIndex].isSoldOut == 1) {
            d++
        }
    }
    if (c.length > 0 && e && ec.skuList.length != d) {
        for (TagIndex in ec.groupTag[0].tags) {
            if (ec.groupTag[0].tags[TagIndex].isSoldOut != 0) {
                if (TagIndex == ec.tagNum) {
                    return
                } else {
                    a = TagIndex;
                    b = ec.groupTag[0].tags[TagIndex].id;
                    ec.selectGroupTagWithSku(0, b, 1, a);
                    return
                }
            }
        }
    }
};
ec.initHasSkuData = function () {
    if (ec.groupTags.length == 0) {
        var b = [];
        var d = [];
        for (var a in ec.groupTag) {
            if (ec.groupTag[a].tags[0].parentId == 0) {
                var f = false;
                for (skuListIndexTemp in ec.skuList) {
                    if (ec.groupTag[a].tags[0].id == ec.skuList[skuListIndexTemp].groupTag[0]) {
                        f = true
                    }
                }
                if (f) {
                    b.push(ec.groupTag[a])
                } else {
                    d.push(ec.groupTag[a])
                }
            }
        }
        b.sort(function (k, j) {
            return k.tags[0].tagSortNum - j.tags[0].tagSortNum
        });
        var h = [];
        for (noHasSkuIndex in d) {
            for (var g in ec.groupTag) {
                if (ec.groupTag[g].tags[0].parentId == 0 && ec.groupTag[g].tags[0].id == d[noHasSkuIndex].tags[0].id) {
                    h.push(g)
                }
            }
        }
        for (delTagIndexTemp in h) {
            ec.groupTag.splice(Number(h[delTagIndexTemp]), 1)
        }
        for (var a in b) {
            var c = [];
            c.push(b[a]);
            for (var g in ec.groupTag) {
                if (b[a].tags[0].id == ec.groupTag[g].tags[0].parentId) {
                    c.push(ec.groupTag[g])
                }
            }
            ec.groupTags.push(c)
        }
        for (groupIndexT in ec.groupTags) {
            if (ec.groupTags[0][0].tags[0].id != ec.groupTags[groupIndexT][0].tags[0].id) {
                ec.groupTags[0][0].tags.push(ec.groupTags[groupIndexT][0].tags[0])
            }
        }
        for (indexG in ec.groupTags) {
            ec.groupTags[indexG][0].tags = ec.groupTags[0][0].tags;
            for (indexGroupT in ec.groupTags[indexG]) {
                for (indexTag in ec.groupTags[indexG][indexGroupT].tags) {
                    for (indexSku in ec.skuList) {
                        if (ec.groupTags[indexG].length == ec.skuList[indexSku].groupTag.length && ec.groupTags[indexG][indexGroupT].tags[indexTag].id == ec.skuList[indexSku].groupTag[indexGroupT]) {
                            ec.groupTags[indexG][indexGroupT].tags[indexTag].hasSku = true;
                            break
                        }
                    }
                }
            }
        }
        for (var e in ec.groupTags[0][0].tags) {
            if (ec.groupTags[0][0].tags[e].isRecommend == 1) {
                ec.tagNum = e
            }
        }
    }
    ec.groupTag = ec.groupTags[ec.tagNum]
};
ec.initSkuGroupTag = function (a) {
    delete ec.selectedProduct.skuId;
    delete ec.selectedProduct.price;
    delete ec.selectedProduct.skuName;
    ec.selectedProduct.groupTagIds = new Array();
    ec.selectedProduct.groupTags = new Array();
    $("showSelected").innerHTML = ec.getSelectedSkuDesc(false);
    var b = "";
    ec.setSoldOutOfTag(0);
    for (index in ec.groupTag) {
        if (index == 0) {
            if (ec.groupTags.length == 1) {
                b += '<div class="honor-version" style = "display:none;"><i>' + ec.groupTag[index].groupName + '：</i><ul id="skuGroup-' + index + '" class="honor-version-list clearfix">' + ec.createGroupNode(index, ec.groupTag[index].tags, a && (index == 0), index) + "</ul></div>"
            } else {
                b += '<div class="honor-version"><i>' + ec.groupTag[index].groupName + '：</i><ul id="skuGroup-' + index + '" class="honor-version-list clearfix">' + ec.createGroupNode(index, ec.groupTag[index].tags, a && (index == 0), index) + "</ul></div>"
            }
        } else {
            b += '<div class="honor-version"><i>' + ec.groupTag[index].groupName + '：</i><ul id="skuGroup-' + index + '" class="honor-version-list clearfix">' + ec.createGroupNode(index, ec.groupTag[index].tags, a && (index == 0), -1) + "</ul></div>"
        }
    }
    b += '<div class="honor-version" id="choose_products"  style = "display:none;"><i>套餐：</i><ul id="packageGroup" class="honor-version-list pro clearfix">' + ec.createSkuGroupNode(ec.getInitSkuList(), a && (ec.groupTag.length == 0)) + "</ul></div>";
    $("choose_area").innerHTML = b
};
ec.getRecommendTagId = function (a) {
    var c = 0;
    var b = 0;
    for (var d = 0; d < a.length; d++) {
        if (a[d].hasSku && (a[d].isSoldOut == 1 || a[d].isSoldOut == 2)) {
            if (b == 0) {
                b = a[d].id
            }
            if (a[d].isRecommend == 1) {
                if (a[0].parentId == 0) {
                    c = a[ec.tagNum].id
                } else {
                    c = a[d].id
                }
                break
            }
        }
    }
    if (c == 0) {
        if (a[0].parentId == 0) {
            c = a[ec.tagNum].id
        } else {
            if (b == 0) {
                c = a[0].id
            } else {
                c = b
            }
        }
    }
    return c
};
ec.getRecommendSkuId = function (b) {
    var c = 0;
    var a = 0;
    for (var d = 0; d < b.length; d++) {
        if (b[d].isSoldOut == 1 || b[d].isSoldOut == 2) {
            if (a == 0) {
                a = b[d].id
            }
            if (b[d].isRecommend == 1) {
                c = b[d].id;
                break
            }
        }
    }
    if (c == 0) {
        c = a
    }
    return c
};
ec.autoSelectTagAndSku = function () {
    if (ec.groupTag.length > 0) {
        ec.selectGroupTagWithSku(0, ec.getRecommendTagId(ec.groupTag[0].tags), ec.groupTag[0].tags[0].isSoldOut, -1)
    } else {
        ec.selectSku(ec.getRecommendSkuId(ec.getSkuListBySelectedTags(ec.selectedProduct.groupTagIds)), ec.getSkuById(ec.getRecommendSkuId(ec.getSkuListBySelectedTags(ec.selectedProduct.groupTagIds))).isSoldOut)
    }
};
ec.selectGroupTagWithSku = function (f, d, a, e) {
    if (e >= 0) {
        ec.tagNum = e;
        ec.lodDefault();
        return
    }
    if (ec.groupTag.length < f + 1) {
        return
    }
    ec.selectSkuGroupTag(f, d, a);
    for (var b = f + 1; b < ec.groupTag.length; b++) {
        ec.selectSkuGroupTag(b, ec.getRecommendTagId(ec.getNextLevelTagList(ec.selectedProduct.groupTagIds)))
    }
    var c = ec.getRecommendSkuId(ec.getSkuListBySelectedTags(ec.selectedProduct.groupTagIds));
    if (c != 0) {
        ec.selectSku(ec.getRecommendSkuId(ec.getSkuListBySelectedTags(ec.selectedProduct.groupTagIds)), ec.getSkuById(ec.getRecommendSkuId(ec.getSkuListBySelectedTags(ec.selectedProduct.groupTagIds))).isSoldOut)
    }
};
ec.selectSkuGroupTag = function (f, d, a) {
    if (ec.groupTag.length < f + 1 || ec.selectedProduct.groupTagIds.length != ec.selectedProduct.groupTags.length || ec.selectedProduct.groupTagIds.length < f) {
        return
    }
    ec.selectedProduct.groupTagIds[f] = d;
    ec.selectedProduct.groupTags[f] = ec.getTagById(f, d).name;
    delete ec.selectedProduct.skuId;
    delete ec.selectedProduct.price;
    delete ec.selectedProduct.skuName;
    $("skuGroupTag-" + d).className = "honor-version-active";
    $("showSelected").innerHTML = ec.getSelectedSkuDesc(false);
    for (tagIndex in ec.groupTag[f].tags) {
        if (ec.groupTag[f].tags[tagIndex].id != d && $("skuGroupTag-" + ec.groupTag[f].tags[tagIndex].id) != null && $("skuGroupTag-" + ec.groupTag[f].tags[tagIndex].id).className == "honor-version-active") {
            $("skuGroupTag-" + ec.groupTag[f].tags[tagIndex].id).className = ""
        }
    }
    if (f + 1 == ec.groupTag.length) {
        var e = ec.getSkuListBySelectedTags(ec.selectedProduct.groupTagIds);
        $("packageGroup").innerHTML = ec.createSkuGroupNode(e, true)
    } else {
        ec.setSoldOutOfTag(f + 1);
        if (ec.selectedProduct.groupTagIds.length != f + 1) {
            ec.selectedProduct.groupTagIds.splice(f + 1, (ec.groupTag.length - f - 1));
            ec.selectedProduct.groupTags.splice(f + 1, (ec.groupTag.length - f - 1));
            for (var c = f + 2; c < ec.groupTag.length; c++) {
                $("skuGroup-" + (c)).innerHTML = ec.createGroupNode(c, ec.groupTag[c].tags, false, -1)
            }
            $("packageGroup").innerHTML = ec.createSkuGroupNode(ec.getInitSkuList(), false, -1)
        }
        var b = ec.getNextLevelTagList(ec.selectedProduct.groupTagIds);
        $("skuGroup-" + (f + 1)).innerHTML = ec.createGroupNode(f + 1, b, true, -1)
    }
};
ec.selectSku = function (b, a) {
    if (b == 0) {
        return false
    }
    if (ec.selectedProduct.skuId == b) {
        return false
    }
    var d = ec.getSkuById(b);
    ec.selectedProduct.skuId = b;
    ec.selectedProduct.price = d.price;
    ec.selectedProduct.skuName = d.name;
    $("prod-" + b).className = "honor-version-active";
    var c = ec.getSkuListBySelectedTags(ec.selectedProduct.groupTagIds);
    for (skuIndex in c) {
        if (c[skuIndex].id != b && $("prod-" + c[skuIndex].id) && $("prod-" + c[skuIndex].id).className == "honor-version-active") {
            $("prod-" + c[skuIndex].id).className = ""
        }
    }
    if (a == "2") {
        if ($("dateup").className == "honor-all-time hide" || $("dateup").className == "honor-all-time honor-btn-time-prompt hide") {
            $("dateup").className = "honor-all-time honor-btn-time-prompt";
            $("dateup").innerHTML = '<span class="honor-prompt"><i class="ico-prompt"></i>还有机会，有用户未完成订单，15分钟内会被取消</span>';
            $("honor-btn").innerHTML = '<a class="honor-btn-end" title="立即申购" href="javascript:;">立即申购</a>';
            ec.endPage = true
        }
    } else {
        if ($("dateup").className == "honor-all-time honor-btn-time-prompt" || $("dateup").className == "honor-all-time hide") {
            ec.hide(["dateup"]);
            $("honor-btn").innerHTML = '<a onclick="ec.buy(this); return false;" href="javascript:;" title="立即申购" class="honor-btn-go">立即申购</a>'
        }
    }
    $("showSelected").innerHTML = ec.getSelectedSkuDesc(false);
    if (ec.loadStatus == 1) {
        ec.loadStatus = 3
    }
    return false
};
ec.returnTop = function () {
    var a = document.body.scrollTop || document.documentElement.scrollTop;
    ec.returnTopWithFixedTime(a)
};
ec.returnTopWithFixedTime = function (a) {
    var b = document.body.scrollTop || document.documentElement.scrollTop;
    window.scrollBy(0, -a / 5);
    if (b > 0) {
        setTimeout("ec.returnTopWithFixedTime(" + a + ")", 20)
    }
};
ec.reSelectTagAndSku = function () {
    ec.returnTop();
    $("showSelected").innerHTML = ec.getSelectedSkuDesc(false)
};
ec.gotoSelectTagAndSku = function () {
    ec.returnTop();
    $("showSelected").innerHTML = ec.getSelectedSkuDesc(false)
};
ec.setScrollAction = function () {
    ec.floatAreaTop = ec.getOffset($("button_area")).top;
    window.onscroll = function () {
        var a = document.body.scrollTop || document.documentElement.scrollTop;
        if (a > ec.floatAreaTop) {
            if ($("packageinfo") != null && $("packageinfo").style.display == "block") {
                ec.showPackage()
            }
            $("button_area").style.position = "fixed";
            $("showSelected").innerHTML = ec.getSelectedSkuDesc(true)
        } else {
            $("button_area").style.position = "absolute";
            $("showSelected").innerHTML = ec.getSelectedSkuDesc(false)
        }
    }
};
ec.checkSelected = function () {
    if (ec.selectedProduct.skuId != null && ec.selectedProduct.groupTagIds.length == ec.groupTag.length && ec.getSkuById(ec.selectedProduct.skuId) != null) {
        return true
    }
    return false
};
ec.isSelectedSkuSoldOut = function (b) {
    for (var a = 0; a < b.groupTagIds.length; a++) {
        if (ec.getTagById(a, b.groupTagIds[a]).isSoldOut == 0) {
            return true
        }
    }
    if (ec.getSkuById(b.skuId).isSoldOut == 0) {
        return true
    }
    return false
};
ec.reselectTagAndSkuBySelected = function (b) {
    for (var a = 0; a < b.groupTagIds.length; a++) {
        ec.selectGroupTagWithSku(a, b.groupTagIds[a])
    }
    ec.selectSku(b.skuId)
};
ec.setSkuStatus = function (b) {
    var a = 0;
    for (skuGroup in ec.skuList) {
        a = 0;
        for (sku in ec.skuList[skuGroup].skuInfo) {
            ec.skuList[skuGroup].skuInfo[sku].isSoldOut = b[ec.skuList[skuGroup].skuInfo[sku].id];
            if (ec.skuList[skuGroup].skuInfo[sku].isSoldOut == 1 || ec.skuList[skuGroup].skuInfo[sku].isSoldOut == 2) {
                a = ec.skuList[skuGroup].skuInfo[sku].isSoldOut
            }
        }
        ec.skuList[skuGroup].isSoldOut = a
    }
};
ec.isSkuAllSoldOut = function () {
    var a = true;
    for (skuGroup in ec.skuList) {
        if (ec.skuList[skuGroup].isSoldOut == 1 || ec.skuList[skuGroup].isSoldOut == 2) {
            a = false;
            break
        }
    }
    return a
};
ec.setSoldOutOfTag = function (b) {
    if (ec.groupTag.length == 0) {
        return
    }
    var a = ec.selectedProduct.groupTagIds.slice(0, b);
    for (indexTag in ec.groupTag[b].tags) {
        a[b] = ec.groupTag[b].tags[indexTag].id;
        if (ec.groupTag[b].tags[indexTag].hasSku) {
            ec.groupTag[b].tags[indexTag].isSoldOut = 0;
            for (indexGroupSku in ec.skuList) {
                if (ec.isTagsEqualToSelected(ec.skuList[indexGroupSku].groupTag, a) && (ec.skuList[indexGroupSku].isSoldOut == 1 || ec.skuList[indexGroupSku].isSoldOut == 2)) {
                    ec.groupTag[b].tags[indexTag].isSoldOut = ec.skuList[indexGroupSku].isSoldOut;
                    break
                }
            }
        }
    }
};
ec.loadSkuStatus = function () {
    if (!ec.loadFist) {
        return
    }
    ec.loadFist = false;
    var b = {};
    if (ec.isRequestFromVmall) {
        b = fromVmallSkuList
    } else {
        b = ec.skuList
    }
    var a = "";
    for (skuGroup in b) {
        for (sku in b[skuGroup].skuInfo) {
            if (b[skuGroup].skuInfo[sku].type == "1") {
                a += b[skuGroup].skuInfo[sku].id + ","
            } else {
                a += b[skuGroup].skuInfo[sku].mainSkuId + ","
            }
        }
    }
    var c = "skuStatusCallback";
    ec.getJson({
        url: ec.url.skuStatus + "?skuIds=" + a + "&t=" + new Date().getTime() + "&callback=" + c,
        funName: c,
        success: function (e) {
            if (e && e.success) {
                if (ec.loadStatus != 4) {
                    var d = {};
                    for (skuGroup in b) {
                        for (sku in b[skuGroup].skuInfo) {
                            if (b[skuGroup].skuInfo[sku].type == "3") {
                                d[b[skuGroup].skuInfo[sku].mainSkuId] = b[skuGroup].skuInfo[sku].id
                            } else {
                                d[b[skuGroup].skuInfo[sku].id] = b[skuGroup].skuInfo[sku].id
                            }
                        }
                    }
                    var f = {};
                    for (rushbuy in e.skuRushBuyInfoList) {
                        if (e.skuRushBuyInfoList[rushbuy].isRushBuySku) {
                            f[d[e.skuRushBuyInfoList[rushbuy].skuId]] = e.skuRushBuyInfoList[rushbuy].skuStatus
                        } else {
                            f[d[e.skuRushBuyInfoList[rushbuy].skuId]] = 1
                        }
                    }
                    ec.setSkuStatus(f);
                    if (ec.isSkuAllSoldOut()) {
                        ec.getStatus(2);
                        ec.setOverPackTagName();
                        return
                    }
                    var g = new Object();
                    g.skuId = ec.selectedProduct.skuId;
                    g.groupTagIds = ec.selectedProduct.groupTagIds.slice(0);
                    ec.initSkuGroupTag(true);
                    if (ec.loadStatus == 3 && !ec.isSelectedSkuSoldOut(g)) {
                        ec.reselectTagAndSkuBySelected(g)
                    } else {
                        ec.autoSelectTagAndSku()
                    }
                    ec.loadStatus = 2;
                    ec.isOutSku()
                }
            }
        }
    })
};
ec.loadStatus = 0;
ec.lazy = true;
ec.isBuy = true;
ec.buy = function (a) {
    if (!ec.lazy) {
        return
    }
    if (!ec.loginFlag) {
        if (ec.isRequestFromVmall) {
            ec.setLoginUrlForVmall()
        }
        location.href = ec.loginUrl;
        return
    }
    if (!ec.checkSelected()) {
        ec.showMessageBox(7);
        return
    }
    ec.lazy = false;
    ec.getStatus(5);
    ec.buyError = setTimeout(function () {
        ec.showMessageBox(6)
    }, 1000 * 8);
    setTimeout(function () {
        if (ec.buyError) {
            clearTimeout(ec.buyError)
        }
        ec.submit()
    }, 500);
    setTimeout(function () {
        ec.lazy = true;
        if (ec.loadStatus == 4) {
            return
        }
        ec.getStatus(1)
    }, 1000 * 8)
};
ec.calculating = false;
ec.calculateResult = "";
ec.retryTime = 5000;
ec.calcCostTime = null;
ec.retryFun = null;
ec.oneMin = null;
ec.quitRequestCount = 12;
ec.joinRequestCount = 0;
ec.rush = function (e, a, f, c, b) {
    if (ec.isRequestFromVmall && !ec.isFireRequest) {
        return
    }
    if (ec.joinRequestCount >= ec.quitRequestCount) {
        if (ec.retryFun) {
            clearTimeout(ec.retryFun)
        }
        if (ec.oneMin) {
            clearTimeout(ec.oneMin)
        }
        ec.showMessageBox(1);
        return
    }
    ec.joinRequestCount = ec.joinRequestCount + 1;
    ec.retryFun = setTimeout(function () {
        ec.rush(e, a, f, c, b)
    }, ec.retryTime);
    var d = e + "&t=" + new Date().getTime();
    if (typeof (Worker) != "function") {
        d = d + "&calculateResult=0"
    } else {
        if (ec.calculateResult) {
            d = d + "&calculateResult=" + ec.calculateResult + "&calcCostTime=" + ec.calcCostTime
        }
    }
    ec.getJson({
        url: d,
        funName: a,
        success: function (m) {
            if (m && m.success) {
                if (ec.flowType == 2) {
                    ec.reserveTimes(m, b)
                } else {
                    var g = ec.url.chooseComponent + "?nowTime=" + f + skus + "&orderSign=" + m.orderSign + "&uid=" + m.uid;
                    if (ec.isRequestFromVmall) {
                        g = g + "&backUrl=" + encodeURIComponent(ec.paramForVmall.backUrl) + (ec.paramForVmall.giftSkus ? "&optionalGiftIds=" + ec.paramForVmall.giftSkus : "") + (ec.paramForVmall.accessoriesSkus ? "&componentIds=" + ec.paramForVmall.accessoriesSkus : "")
                    }
                    window.location.href = g
                }
            } else {
                if (typeof (Worker) == "function" && !ec.calculating && m && m.calNum) {
                    var j = new Date().getTime();
                    ec.calculating = true;
                    var l = new Worker("/js/ti6.min.js");
                    var k = {
                        start: m.calNum,
                        end: (m.calLen ? m.calLen : 5000),
                        reLength: (m.retLen ? m.retLen : 20)
                    };
                    if (m.A00) {
                        k.A00 = m.A00
                    }
                    if (m.A11) {
                        k.A11 = m.A11
                    }
                    if (m.A22) {
                        k.A22 = m.A22
                    }
                    l.postMessage(JSON.stringify(k));
                    l.onmessage = function (n) {
                        ec.calculateResult = n.data;
                        ec.calcCostTime = new Date().getTime() - j
                    }
                }
                if (m && m.code) {
                    if (m.code == 4 || m.code == 6 || m.code == 8 || m.code == 9) {
                        if ((ec.retryFun || ec.oneMin) && m.code != 9) {
                            clearTimeout(ec.retryFun);
                            clearTimeout(ec.oneMin)
                        }
                        if (m.code == 4) {
                            ec.showMsgSoldOut()
                        } else {
                            if (m.code == 6) {
                                ec.showBox()
                            } else {
                                if (m.code == 8) {
                                    ec.account.change()
                                } else {
                                    if (m.code == 9) {
                                        var h = ec.util.cookie.get("uid");
                                        if (h) {
                                            ec.getQualification(h)
                                        } else {
                                            if (ec.isRequestFromVmall) {
                                                ec.setLoginUrlForVmall()
                                            }
                                            location.href = ec.loginUrl
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                return
            }
        }
    })
};
ec.reserveTimes = function (e, b) {
    var a = "";
    var d = "skuStatusCallback";
    ec.getJson({
        url: ec.url.reserveInv + "?mainSku=" + ec.selectedProduct.skuId + "&activityId=" + ec.activityId + "&duid=" + e.uid + "&orderSign=" + e.orderSign + "&t=" + new Date().getTime() + (b ? "&coverFlag=" + b : "") + "&callback=" + d,
        funName: d,
        success: function (h) {
            if (h.success) {
                var g = ec.util.cookie.get("uid");
                ec.util.cookie.remove("reserveTimeout_" + ec.activityId + "_" + ec.selectedProduct.skuId + "_" + g);
                a = h.reserveTimes;
                a = a * 1000;
                var j = new Date();
                j = j.getFullYear() + "-" + (j.getMonth() + 1) + "-" + j.getDate() + " " + j.getHours() + ":" + j.getMinutes() + ":" + j.getSeconds();
                var f = "&skuId=" + ec.selectedProduct.skuId + "&skuIds=" + ec.selectedProduct.skuId + "&activityId=" + ec.activityId;
                var c = ec.url.chooseComponent + "?nowTime=" + j + f + "&orderSign=" + e.orderSign + "&uid=" + e.uid;
                if (ec.isRequestFromVmall) {
                    c = c + "&backUrl=" + encodeURIComponent(ec.paramForVmall.backUrl) + (ec.paramForVmall.giftSkus ? "&optionalGiftIds=" + ec.paramForVmall.giftSkus : "") + (ec.paramForVmall.accessoriesSkus ? "&componentIds=" + ec.paramForVmall.accessoriesSkus : "")
                }
                window.location.href = c + (a ? "&reserveTimes=" + a : "")
            } else {
                if (h.code != 1) {
                    clearTimeout(ec.retryFun);
                    clearTimeout(ec.oneMin)
                }
                if (h.code == 1) {} else {
                    if (h.code == 2) {
                        ec.showMessageBox(13)
                    } else {
                        if (h.code == 3) {
                            ec.showMessageBox(11)
                        } else {
                            if (h.code == 4) {
                                ec.showMessageBox(10, h.orderCode)
                            } else {
                                if (h.code == 5) {
                                    ec.showMessageBox(12, null, h, e.uid)
                                } else {
                                    if (h.code == 6) {
                                        ec.showMsgSoldOut()
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    })
};
var coverFlag = "";
ec.submit = function (b) {
    if (b && b == "1") {
        coverFlag = 1
    }
    ec.creatOrderUrl = "//ord01.vmall.com/order/pwm86t/createOrder.do";
    if (ec.retryFun) {
        clearTimeout(ec.retryFun)
    }
    if (ec.oneMin) {
        clearTimeout(ec.oneMin)
    }
    ec.showMsgWait();
    var f = new Date();
    f = f.getFullYear() + "-" + (f.getMonth() + 1) + "-" + f.getDate() + " " + f.getHours() + ":" + f.getMinutes() + ":" + f.getSeconds();
    var a = "callback" + new Date().getTime(),
        c = ec.selectedProduct.skuId,
        d = ec.account.getLoginPars(),
        e = ec.creatOrderUrl + "?nowTime=" + f + "&callback=" + a;
    skus = "&skuId=" + c + "&skuIds=" + c + "&activityId=" + ec.activityId;
    e = e + skus + ec.code + d;
    if (ec.submitUrl) {
        e = ec.submitUrl + "&callback=" + a
    }
    ec.joinRequestCount = 0;
    ec.oneMin = setTimeout(function () {
        if (ec.retryFun) {
            clearTimeout(ec.retryFun)
        }
        ec.showMessageBox(1)
    }, 60 * 1000);
    ec.rush(e, a, f, d, coverFlag)
};
ec.getStatus = function (a) {
    var b = "";
    switch (a) {
        case 1:
            b = '<a onclick="ec.buy(this); return false;" href="javascript:;" title="立即申购" class="honor-btn-go">立即申购</a>';
            ec.hide(["dateup"]);
            break;
        case 2:
            if (ec.hasNextQueue == 1) {
                b = '<a href="' + ec.nextQueueUrl + '" title="预约下轮抢购" class="honor-btn-go">预约下轮抢购</a>'
            } else {
                b = '<a class="honor-btn-end" title="已售完" href="javascript:;">已售完</a>';
                ec.hide(["dateup"]);
                ec.hide(["countdown"])
            }
            ec.show(["soldOutSection"]);
            ec.loadStatus = 4;
            ec.getSelectedSkuDesc = function () {
                return ""
            };
            ec.initSkuGroupTag(false);
            break;
        case 3:
            $("boxHeader").innerHTML = '<img src="//res.vmallres.com/activity/20160527/sale/images/rushbuyV3.0/web/ic_cry.jpg">';
            b = ' <a class="honor-btn-go" title="' + ec.noQueueText + '" href="' + ec.url.gotoQueue + '">' + ec.noQueueText + "</a>";
            break;
        case 4:
            b = '<a id="login-btn-2"  class="honor-btn-go" title="立即申购" href="javascript:;">立即申购</a>';
            ec.hide(["dateup"]);
            break;
        case 5:
            b = '<a class="honor-btn-end" title="正在提交请求" href="javascript:;">正在提交请求</a>';
            break;
        default:
            b = '<a style="display:none;" class="honor-btn-ready" title="即将发售" href="javascript:;">即将发售</a>';
            break
    }
    $("honor-btn").innerHTML = b
};
ec.time = function (b, a) {
    ec.util.countdown("countdown", {
        html: "倒计时:<b>{#hours}</b>时<b>{#minutes}</b>分<b>{#seconds}</b>秒",
        now: b.getTime(),
        startTime: a.getTime(),
        callback: function (c) {
            if (!ec.loginFlag) {
                ec.getStatus(4);
                ec.setLoginUrl(ec.loginUrl);
                ec.hide(["countdown"])
            } else {
                ec.getStatus(1);
                ec.hide(["countdown"])
            }
            delete ec._cache["countdown" + a.getTime()]
        }
    })
};
ec.show = function (b) {
    for (var c = 0; c < b.length; c++) {
        $(b[c]).className = $(b[c]).className.replace(" hide", "")
    }
};
ec.hide = function (b) {
    for (var c = 0; c < b.length; c++) {
        $(b[c]).className = $(b[c]).className.replace(" hide", "");
        $(b[c]).className = $(b[c]).className + " hide"
    }
};
ec.gotoQuestion = function () {
    if (!ec.isBuy) {
        return
    }
    ec.show(["activity_layout"]);
    ec.hide(["activity_main", "hot_prod", "msg_wait", "msg_soldout"]);
    $("answer").value = ""
};
ec.showMsgSoldOut = function () {
    ec.show(["msg_soldout", "hot_prod", "activity_layout"]);
    ec.hide(["activity_main", "msg_wait"])
};
ec.showMsgWait = function () {
    ec.show(["msg_wait", "activity_layout"]);
    ec.hide(["activity_main", "hot_prod", "msg_soldout"])
};
ec.setLoginUrl = function (a) {
    if (!a) {
        return
    }
    if ($("login-btn-2")) {
        $("login-btn-2").href = a
    }
    $("login-btn-1").href = a
};
ec.closeBox = function () {
    $("box-mask").style.display = "none";
    $("honor-box").style.display = "none";
    window.onresize = null
};
ec.goOrderUrl = function (a) {
    var b = (new Date()).valueOf();
    window.location.href = ec.url.vmall + "/member/order-" + a
};
ec.goBuyServiceUrl = function (g) {
    var d = ec.util.cookie.get("uid");
    ec.util.cookie.remove("reserveTimeout_" + ec.activityId + "_" + _paramForJson.currentMainSku + "_" + d);
    var f = new Date();
    f = f.getFullYear() + "-" + (f.getMonth() + 1) + "-" + f.getDate() + " " + f.getHours() + ":" + f.getMinutes() + ":" + f.getSeconds();
    var b = "&skuId=" + _paramForJson.currentMainSku + "&skuIds=" + _paramForJson.currentMainSku + "&activityId=" + ec.activityId;
    var a = ec.url.chooseComponent + "?nowTime=" + f + b + "&orderSign=" + _paramForJson.currentOrderSign + "&uid=" + g;
    if (ec.isRequestFromVmall) {
        a = a + "&backUrl=" + encodeURIComponent(ec.paramForVmall.backUrl) + (ec.paramForVmall.giftSkus ? "&optionalGiftIds=" + ec.paramForVmall.giftSkus : "") + (ec.paramForVmall.accessoriesSkus ? "&componentIds=" + ec.paramForVmall.accessoriesSkus : "")
    }
    var e = _paramForJson.reserveTimes * 1000;
    window.location.href = a + (e ? "&reserveTimes=" + e : "")
};
ec.getScroll = function () {
    var a;
    if (document.documentElement && document.documentElement.scrollTop) {
        a = document.documentElement.scrollTop
    } else {
        if (document.body) {
            a = document.body.scrollTop
        }
    }
    return a
};
ec.calcBox = function () {
    var a = document.body.clientWidth,
        d = document.body.clientHeight,
        c = $("honor-box").offsetHeight,
        b = $("honor-box").offsetWidth;
    $("honor-box").style.left = a / 2 - b / 2 + "px";
    $("honor-box").style.top = d / 2 - c / 2 + "px";
    $("honor-box").style.position = "fixed"
};
ec.calculateMaskSize = function () {
    var c = document.documentElement.clientHeight ? document.documentElement : document.body,
        a = c.scrollHeight > c.clientHeight ? c.scrollHeight : c.clientHeight,
        d = c.scrollWidth > c.clientWidth ? c.scrollWidth : c.clientWidth;
    $("box-mask").style.width = d + "px";
    $("box-mask").style.height = a + "px"
};
ec.showBox = function () {
    $("box-mask").style.display = "block";
    $("honor-box").style.display = "block";
    ec.calculateMaskSize();
    ec.calcBox();
    window.onresize = ec.calculateMaskSize;
    var a = window.onscroll;
    window.onscroll = function () {
        ec.calcBox();
        if (a) {
            a()
        }
    }
};
ec.getQualification = function (a) {
    var b = "callbackqueue";
    ec.getJson({
        url: ec.url.qualification + "?uid=" + a + "&qid=" + ec.qid + "&callback=" + b,
        funName: b,
        success: function (d) {
            try {
                delete window[b]
            } catch (c) {
                window[b] = null
            }
            if (d) {
                if (d.isqueue && d.queueSign) {
                    var f = {
                        expires: ec.endTime
                    };
                    ec.util.cookie.set("isqueue-" + ec.activityId + "-" + a, d.isqueue, f);
                    ec.util.cookie.set("queueSign-" + ec.activityId + "-" + a, d.queueSign, f);
                    if (ec.needQueue && d.isqueue == 2) {
                        if (ec.oneMin) {
                            clearTimeout(ec.oneMin)
                        }
                        ec.getStatus(3);
                        $("queue_next_1").href = ec.url.gotoQueue;
                        if (ec.isRequestFromVmall) {
                            ec.showMsgWait()
                        }
                        ec.showBox();
                        ec.isFireRequest = false;
                        return
                    }
                }
            }
        }
    })
};
ec.checkQualification = function (a) {
    if (ec.util.cookie.get("isqueue-" + ec.activityId + "-" + a) && ec.util.cookie.get("queueSign-" + ec.activityId + "-" + a)) {
        if (ec.needQueue && ec.util.cookie.get("isqueue-" + ec.activityId + "-" + a) == 2) {
            ec.getStatus(3);
            $("queue_next_1").href = ec.url.gotoQueue;
            if (ec.isRequestFromVmall) {
                ec.showMsgWait()
            }
            ec.showBox();
            ec.isFireRequest = false
        }
        return
    }
    ec.getQualification(a)
};
ec.load = function () {
    if (ec.isActivityEnded()) {
        ec.changeHtmlWhenActivityIsEnded();
        if (ec.loadStatus == 4) {
            ec.setOverPackTagName()
        }
        return
    }
    var a = !-[1];
    var b = new Date().getTime(),
        c = ec.startTime;
    c.setMinutes(ec.startTime.getMinutes() + 2);
    document.onkeydown = function (d) {
        var e = (a) ? event.keyCode : d.which;
        if (e == 116 && b <= c.getTime()) {
            document.body.style.display = "none";
            setTimeout(function () {
                document.body.style.display = "block"
            }, Math.floor(Math.random() * 1000 + 50));
            if (a) {
                event.keyCode = 0;
                event.cancelBubble = true
            } else {
                d.preventDefault()
            }
            return false
        }
    };
    setTimeout(function () {
        if (ec.util.cookie.get("uid") && ec.util.cookie.get("hasImg") != "1") {
            var d = $("1px");
            d.src = d.attributes["data-lazy-src"].value;
            d.attributes["data-lazy-src"].value = "";
            ec.util.cookie.set("hasImg", "1")
        }
    }, 500);
    setTimeout(function () {
        if (ec.account.isLogin()) {
            if (ec.bindPhoneTips && !ec.account.isBindPhone()) {
                ec.showMessageBox(3);
                ec.isFireRequest = false
            } else {
                if (ec.needBindPhone && !ec.account.isBindPhone()) {
                    ec.showMessageBox(2);
                    $("honor-btn").innerHTML = '<a id="to_main" class="honor-btn-go" title="返回商城首页" href="' + ec.url.vmall + '">返回商城首页</a>';
                    ec.isFireRequest = false
                } else {
                    var d = ec.util.cookie.get("uid");
                    if (d) {
                        ec.checkQualification(d)
                    }
                }
            }
        }
    }, 300)
};
ec.showPackage = function () {
    var c = $("packageinfo");
    if (c.style.display == "block") {
        $("contrastAllPackage").className = "honor-version-all clearfix";
        c.style.display = "none"
    } else {
        if (c.style.display == "none") {
            $("contrastAllPackage").className = "honor-version-all honor-version-all-hover clearfix";
            c.style.display = "block";
            var b = ec.getOffset(c).left;
            var a = b + 700;
            if (b < 0) {
                c.style.left = c.offsetLeft - b + "px"
            } else {
                if (a > document.body.clientWidth) {
                    c.style.left = c.offsetLeft - (a - document.body.clientWidth) + "px"
                }
            }
        }
    }
};
ec.getconfskutag = function () {
    var a = ec.util.getRandom(1, 10);
    return "//cfm" + ((a < 10) ? "0" + a : a) + ".vmall.com/" + ec.activityId + "-inventory.json"
};
ec.checkLoginTime = function () {
    var a = ec.util.cookie.get("ts") && ((new Date().getTime() - ec.util.cookie.get("ts")) > (24 * 60 * 60 * 1000));
    if (a) {
        ec.account.change()
    }
};
ec.isActivityEnded = function () {
    if (new Date().getTime() >= ec.endTime.getTime()) {
        return true
    }
    return false
};
ec.changeHtmlWhenActivityIsEnded = function () {
    ec.getStatus(2)
};
ec.lab_load = function (a, b) {
    $(a).style.display = "none";
    $(b).focus()
};
ec.lab_hide_show = function (c, d) {
    var b = $(d).value;
    if (b == "" || b == null || b == undefined) {
        $(c).style.display = "block"
    } else {
        $(c).style.display = "none"
    }
};
ec.lodDefault = function () {
    ec.initForVmall();
    ec.account.init();
    ec.init(true, true);
    ec.load()
};
var _paramForJson;
ec.showMessageBox = function (c, a, b, f) {
    if (ec.isRequestFromVmall && c != 1 && c != 2 && c != 3 && c != 9 && c != 10 && c != 11 && c != 12 && c != 13) {
        return
    }
    if (c == 1 || c == 2 || c == 10 || c == 11 || c == 12 || c == 13) {
        $("boxCloseBtn").style.display = "none"
    } else {
        $("boxCloseBtn").style.display = "block"
    }
    if (c == 1 || c == 2 || c == 3 || c == 10) {
        if (c == 1) {
            $("boxHeader").innerHTML = '<img src="//res.vmallres.com/activity/20160527/sale/images/rushbuyV3.0/web/ic_expect.jpg">'
        } else {
            $("boxHeader").innerHTML = '<img src="//res.vmallres.com/activity/20160527/sale/images/rushbuyV3.0/web/ic_smile.jpg">'
        }
        $("boxHeader").className = "box-header"
    } else {
        $("boxHeader").innerHTML = "";
        $("boxHeader").className = "hr-30"
    }
    if (c == 1) {
        $("boxText").innerHTML = "当前参与人数过多，您可以再试一次。";
        $("boxButton").innerHTML = '<a href="' + ec.url.activity + '" title="看看其它商品" class="honor-box-btn" >看看其它商品</a><a href="javascript:;" onclick="ec.closeBox();ec.submit(this);return false;" title="再试一次" class="honor-box-btn-go" >再试一次</a>'
    } else {
        if (c == 2) {
            $("boxText").innerHTML = "手机帐号或已绑定手机的邮箱帐号才可以参加抢购，您可以";
            $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.account.change();" class="honor-box-btn">切换手机帐号</a><a href="javascript:;" onclick="ec.account.toBindPhone();" class="honor-box-btn">绑定手机</a>'
        } else {
            if (c == 3) {
                $("boxText").innerHTML = '<span class="honor-box-icon-1" id="boxIcon"></span><p style="text-align: left;">亲，为了更好的给您提供服务，我们建议您：<br/>1、切换手机帐号；<br/>2、用手机号绑定目前的邮箱帐号，绑定后手机号和邮箱帐号都可以作为登录帐号</p>';
                $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.closeBox();" class="honor-box-btn">下次再说</a><a href="javascript:;" onclick="ec.account.toBindPhone();" class="honor-box-btn-go">去绑定</a>'
            } else {
                if (c == 4) {
                    $("boxText").innerHTML = "活动未开始，请校准本机时间到北京时间后再刷新页面";
                    $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.closeBox();" class="honor-box-btn-go">确定</a>'
                } else {
                    if (c == 5) {
                        $("boxText").innerHTML = "活动已结束";
                        $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.closeBox();" class="honor-box-btn-go">确定</a>'
                    } else {
                        if (c == 6) {
                            $("boxText").innerHTML = "抢购人数太多，请稍后重试";
                            $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.closeBox();" class="honor-box-btn-go">确定</a>'
                        } else {
                            if (c == 7) {
                                $("boxText").innerHTML = "请选择您要的商品或套餐";
                                $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.closeBox();" class="honor-box-btn-go">确定</a>'
                            } else {
                                if (c == 9) {
                                    $("boxText").innerHTML = "感谢参与，我们将在下次到货前，优先通知您，提醒购买";
                                    $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.closeBox();" class="honor-box-btn-go">确定</a>'
                                } else {
                                    if (c == 10) {
                                        $("boxText").innerHTML = "本次发售每个帐号仅能购买1台，您已提交过订单，请将机会留给他人吧~";
                                        $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.goOrderUrl(' + a + ');" title="查看订单" class="honor-box-btn" >查看订单</a>'
                                    } else {
                                        if (c == 11) {
                                            $("boxText").innerHTML = "对不起，您有逾期未提交订单情况，不能再参加本场活动";
                                            $("boxButton").innerHTML = '<a href="' + ec.url.activity + '"  title="确定" class="honor-box-btn-go" >确定</a>'
                                        } else {
                                            if (c == 13) {
                                                $("boxText").innerHTML = "很遗憾，您晚了一步，当前版本库存不足";
                                                $("boxButton").innerHTML = '<a href="' + ec.url.activity + '"  title="看看别的" class="honor-box-btn" >看看别的</a>'
                                            } else {
                                                if (c == 12) {
                                                    _paramForJson = b;
                                                    var e;
                                                    var d = {};
                                                    if (ec.isRequestFromVmall) {
                                                        d = fromVmallSkuList
                                                    } else {
                                                        d = ec.skuList
                                                    }
                                                    for (skuGroup in d) {
                                                        for (sku in d[skuGroup].skuInfo) {
                                                            if (d[skuGroup].skuInfo[sku].id == b.currentMainSku) {
                                                                e = d[skuGroup].skuInfo[sku].skuName
                                                            }
                                                        }
                                                    }
                                                    $("boxText").innerHTML = "您已经获得" + e + "的购买资格，继续提交会重新排队，如果排队成功将会替换掉已获得的购买资格。是否继续？";
                                                    $("boxButton").innerHTML = '<a href="javascript:;" onclick="ec.goBuyServiceUrl(\'' + f + '\');"  title="查看订单详情" class="honor-box-btn" >查看订单详情</a><a href="javascript:;" onclick="ec.closeBox();ec.submit(1);return false;"  title="继续提交" class="honor-box-btn" id="1">继续提交</a>'
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    ec.showBox()
};
